/*
 * @Description: 项目经理月报数据模型
 * @Author: wind-lc
 * @version: 1.0
 * @Date: 2022-04-06 10:23:39
 * @LastEditTime: 2022-04-11 10:02:54
 * @FilePath: \cscec-pms-admin\src\views\project\projectManagerMonthlyReport\model.js
 */
// 状态
const status = [
  {
    value: 0,
    label: '待提交'
  },
  {
    value: 1,
    label: '审核中'
  },
  {
    value: 2,
    label: '审核不通过'
  },
  {
    value: 3,
    label: '审核通过'
  }
]
// 项目经理月报搜索项
const searchOption = [
  {
    name: '项目经理名称',
    value: 'pmName',
    type: 'input',
  },
  {
    name: '报告月度',
    value: 'reportMonthly',
    type: 'monthRange',
    attr: {
      rangeFormat: ['reportMonthlyStartTime', 'reportMonthlyEndTime']
    }
  },
  {
    name: '状态',
    value: 'status',
    type: 'select',
    data: status
  }
]
// 项目经理月报表头
const columns = [
  {
    title: '序号',
    width: 80,
    align: 'center',
    customRender: (text, record, index) => {
      return index + 1
    }
  },
  {
    title: '项目经理名称',
    ellipsis: true,
    width: 100,
    dataIndex: 'pmName'
  },
  {
    title: '所属项目',
    ellipsis: true,
    width: 100,
    dataIndex: 'projectName'
  },
  {
    title: '所属分公司',
    ellipsis: true,
    width: 120,
    dataIndex: 'branchComName'
  },
  {
    title: '报告期数',
    ellipsis: true,
    width: 120,
    align: 'center',
    dataIndex: 'reportPeriods'
  },
  {
    title: '报告月度',
    ellipsis: true,
    width: 120,
    align: 'center',
    dataIndex: 'reportMonthly'
  },
  {
    title: '状态',
    ellipsis: true,
    width: 120,
    align: 'center',
    dataIndex: 'status',
    customRender: (text) => {
      return status.find(el => el.value === text)?.label
    }
  },
  {
    title: '操作',
    dataIndex: 'operation',
    width: 180,
    align: 'center',
    scopedSlots: { customRender: 'operation' }
  }
]
// 基本信息表单项
const formOption = [
  {
    label: '项目经理名称',
    keyName: 'pmName',
    type: 'BaseInput',
    disabled: true
  },
  {
    label: '所属单位',
    keyName: 'projectId',
    isNeedAuth: true,
    type: 'orgTree',
    disabled: true,
    span: 16
  },
  // {
  //   label: '所属分公司',
  //   keyName: 'branchComName',
  //   type: 'BaseInput',
  //   disabled: true
  // },
  // {
  //   label: '所属项目',
  //   keyName: 'projectName',
  //   type: 'BaseInput',
  //   disabled: true
  // },

  {
    label: '项目编号',
    keyName: 'projectCode',
    type: 'BaseInput',
    disabled: true
  },
  {
    label: '报告期数',
    keyName: 'reportPeriods',
    type: 'BaseInput',
    disabled: true
  },
  {
    label: '报告月度',
    keyName: 'reportMonthly',
    type: 'BaseInput',
    disabled: true
  },
  {
    label: '填写时间',
    keyName: 'modifiedTime',
    type: 'BaseInput',
    disabled: true
  }
]
// 项目运行情况综述表单项
const formOption1 = [
  {
    label: '总体运行情况',
    keyName: 'runSituation',
    type: 'BaseTextarea',
    attrs: {
      maxLength: 3000
    },
    rules: [{ required: true, message: '请输入总体运行情况', trigger: 'change' }],
    span: 24
  },
  {
    label: '完美履约情况',
    keyName: 'performanceSituation',
    type: 'BaseTextarea',
    attrs: {
      maxLength: 3000
    },
    rules: [{ required: true, message: '请输入完美履约情况', trigger: 'change' }],
    span: 24
  },
  {
    label: '施工生产主要关注点及影响因素描述',
    keyName: 'describe',
    type: 'BaseTextarea',
    attrs: {
      maxLength: 3000
    },
    rules: [{ required: true, message: '请输入施工生产主要关注点及影响因素描述', trigger: 'change' }],
    span: 24
  },
  {
    label: '应对措施',
    keyName: 'measures',
    type: 'BaseTextarea',
    attrs: {
      maxLength: 3000
    },
    rules: [{ required: true, message: '请输入应对措施', trigger: 'change' }],
    span: 24
  }
]
// 下月工作的主要计划及思路表单项
const formOption2 = [
  {
    label: '下月工作的主要计划及思路',
    keyName: 'nextMonthPlans',
    type: 'BaseTextarea',
    attrs: {
      maxLength: 3000
    },
    rules: [{ required: true, message: '请输入下月工作的主要计划及思路', trigger: 'change' }],
    span: 24
  }
]
// 需公司、二级单位解决的主要问题表头
const columns1 = [
  {
    title: '序号',
    width: 80,
    align: 'center',
    customRender: (text, record, index) => {
      return index + 1
    }
  },
  {
    title: '需协调解决的问题',
    ellipsis: true,
    dataIndex: 'problemSolved',
    scopedSlots: { customRender: 'problemSolved' }
  },
  {
    title: '解决时间要求',
    ellipsis: true,
    dataIndex: 'temporalDemand',
    scopedSlots: { customRender: 'temporalDemand' }
  },
  {
    title: '需配合单位',
    ellipsis: true,
    dataIndex: 'assortUnit',
    scopedSlots: { customRender: 'assortUnit' }
  },
  {
    title: '需配合岗位及人员',
    ellipsis: true,
    dataIndex: 'assortPost',
    scopedSlots: { customRender: 'assortPost' }
  },
  {
    title: '备注',
    ellipsis: true,
    dataIndex: 'remark',
    scopedSlots: { customRender: 'remark' }
  },
  {
    title: '操作',
    dataIndex: 'operation',
    width: 120,
    align: 'center',
    scopedSlots: { customRender: 'operation' }
  }
]

export {
  searchOption,
  columns,
  formOption,
  formOption1,
  formOption2,
  columns1
}
